package com.atguigu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Data
public class RegisterVo {

    // 用户名
    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6,max = 18,message = "用户名:最小长度不能低于6位,最大长度不能超过10位")
    private String userName;

    // 密码
    @NotEmpty(message = "密码必须填写")
    @Length(min = 6,max = 18,message = "密码:最小长度不能低于6位,最大长度不能超过10位")
    private String passWord;

    // 手机号
    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机格式不正确") // 正则表达式
    private String phone;

    // 短信验证码
    @NotEmpty(message = "短信验证码必须填写")
    private String code;

}
